/**
 * GeneralSystemMarshalling.java
 * ************************** 
 * @date Apr 18, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package infrastructureAPI.backendGate;

import java.net.InetAddress;

import infrastructureAPI.APIMessages.RequestMessage;
import infrastructureAPI.algorithms.APIFunction;

/**
 * Description:
 * This is a very naive implementation of the RequestMarshalling
 * interface. 
 * This class simply takes advantage of the inserted APIFunction.
 * It passes the local address and the node name to the method
 * createRequestMessage of the APIFunction,
 * that's able to generate the RequestMessage. 
 *
 */
public class GeneralSystemsMarshaller implements RequestMarshalling {

	@Override
	public RequestMessage marshalRequest(InetAddress localAddress, 
			String localNodeName, APIFunction apiFunc) {
		return apiFunc.createRequestMessage(localAddress, localNodeName);
	}


}
